include ../../../rpcsys.mk

TARGET		= calc_serv
SRCS		= $(wildcard *.cpp)
OBJS     	= $(patsubst %.cpp, %.o, $(SRCS))
TARGET_OBJS	= $(addprefix $(OBJ_DIR)/, $(OBJS))
DEP_LIBS	= ../proto/libproto_calc.a $(RPCSYS_LIBPATH)/librpcsys.a
DEP_INCPATH = -I$(RPCSYS_HOME)/sys/src

.PHONY : all clean depend

all : depend $(TARGET)

-include .depend

$(TARGET) : $(TARGET_OBJS)
	$(CC) $(RPCSYS_CXXFLAG) -o $@ $^ $(DEP_LIBS) $(RPCSYS_LIBS) $(RPCSYS_DYNLIBS)

$(OBJ_DIR)/%.o : %.cpp
	$(CC) $(RPCSYS_CXXFLAG) $(RPCSYS_DEFINED) $(PRCSYS_INC) -c $< -o $@

depend : $(SRCS)
	$(CC) -MM $(PRCSYS_INC) $^ > .depend
	@-(./replace.sh)

clean:
	@-(rm $(OBJ_DIR)/*.o $(TARGET) .depend)
